/*
 * @Description: 登录相关接口
 * @Autor: lds
 * @LastEditors: lds
 */
import request from '../utils/request'
import url from './url'
namespace Login {
  // 用户登录表单
  export interface LoginReqForm {
    username: string;
    password: string;
  }
  // 登录成功后返回的token
  export interface LoginResData {
    token: string;
  }
}
// 用户登录
export const login = (params: Login.LoginReqForm,method:'get'|'post'|'put'|'delete'='get') => {
    // 返回的数据格式可以和服务端约定
    return request[method]<Login.LoginResData>(url.login, params);
}